package com.golf.core.course;

import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

import com.golf.core.course.bodies.Ball;
import com.golf.core.course.bodies.CourseBodies;
import com.golf.core.course.bodies.CourseBoundary;
import com.golf.core.course.bodies.Position;

public class SimpleCourse implements Course
{

    private final String name;

    
    private final Position startPosition;
    
    
    private CourseBoundary boundary;
    
    private CourseBodies bodies;
    
    private Set<Ball> balls;
    
    
    public SimpleCourse(final String name, final Position startPosition)
    {
        this.name = name;
        this.startPosition = startPosition;
        
        bodies = new CourseBodies();
        
    }


    public String name()
    {
        return name;
    }

    public CourseBodies getBodies()
    {
        return bodies;
    }


    /**
     * {@inheritDoc}
     */
	public Position getStartPosition() 
	{
		return startPosition;
	}



    /**
     * {@inheritDoc}
     */
    public CourseBoundary getBoundary()
    {
        return boundary;
    }

    // NOTSURE IF I WANT THIS IMMUTBLE - THINK SO
    public void setBoundary(final CourseBoundary boundary)
    {
        this.boundary = boundary;
    }

    
    /**
     * {@inheritDoc}
     */
    public void placeBalls(final Collection<Ball> balls)
    {
        this.balls = new HashSet<Ball>(balls);
    }
        
}
